#ifndef _INC_DLIST_ELEM_T_H_
#define _INC_DLIST_ELEM_T_H_

template<class T>
class DlistElem_t
{
public:
	/**
	* Type enumeration
	*/
	enum ElemType {
		HEAD,
		ELEM,
		TAIL
	};

	/**
	* Ctor
	*/
	DlistElem_t(T* data);

	/**
	* Ctor
	*/
	DlistElem_t(ElemType type);

	/**
	* Dtor
	*/
	virtual ~DlistElem_t();

	/**
	* Returns elem type
	*/
	inline ElemType type() const {
		return m_type;
	}

	/**
	* Returns elem data
	*/
	T* get() const;

	/**
	* Returns next elem
	*/
	DlistElem_t* next() const;

	/**
	* Sets next elem
	*/
	void setNext(DlistElem_t* const elem);

	/**
	* Returns previous elem
	*/
	DlistElem_t* prev() const;

	/**
	* Sets previous elem
	*/
	void setPrev(DlistElem_t* const elem);

private:
	/**
	* Copy Ctor
	*/
	DlistElem_t(const DlistElem_t& other);

	/**
	* Assignment operator
	*/
	DlistElem_t& operator=(const DlistElem_t& other);

	ElemType m_type; // Elem type
	T* m_data; // Elem data
	DlistElem_t* m_next; // Next elem
	DlistElem_t* m_prev; // Previous elem
};

#include "DlistElem_t.hpp"

#endif // _INC_DLIST_ELEM_T_H_